home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / FREENET / JENKIN / 023C / 023c / SA / SAsource (.txt) < prev   
RISC OS BBC BASIC V Source  |  1998-09-20  |  20KB  |  923 lines

  1.  connect status :
  2.  0 = not connected
  3.  1 = trying
  4.  2 = *** reserved ***
  5.  +-2.5 waiting for confirmation of connect
  6.  3 = connected
  7.  +- 3.5 = download initiated
  8.  4 = downloaded
  9.  5 = ticking (on/off)
  10.  y% 8
  11.  y%!0=&4AF80:y%!4=&400C1
  12.  "Wimp_Initialise",310,&4B534154,"Ticker",y% 
  13.  ,task%
  14. close:
  15. $+" code "+
  16.  "Hourglass_Smash":
  17.  "OS_ReadMonotonicTime" 
  18.  time%
  19.  saold=time%
  20.  "Wimp_ReadSysInfo",7 
  21.  wimp
  22.  wimp>=350 
  23.  wimp=
  24.  wimp=
  25.  connectstatus=1
  26.  mtresolv 
  27.  FIRSTGO 
  28. open_resolver_window
  29.  dragging 
  30.  inwindow 
  31. colourchange
  32.  connectstatus>=4 
  33.  headlineget 
  34. init_sockets:connectstatus=1
  35.  connectstatus 
  36. ,     
  37.  (toggle 
  38.  dragging) 
  39.      
  40. firstone
  41.      
  42.  3.5:
  43. threepointfive
  44.      
  45. httpget
  46.      
  47.  2.5:
  48. connect
  49.      
  50. resolve
  51.  "OS_ReadMonotonicTime" 
  52.  newtime%
  53.  (newtime%-time% > update*6000 
  54. sysvar("Ticker$Update")) 
  55.  (toggle 
  56.  sleep) 
  57.  updateonoff 
  58. ticker_update
  59.  quit%
  60. close
  61. httpget
  62.  ptr%,flags%, request$, file$
  63.  headlineget 
  64.  file$="headline" 
  65.  file$="story2"
  66. /8   request$="GET /tickerdata/"+file$+".dat HTTP/1.0"
  67. 0[   
  68.  proxyonoff 
  69.  request$="GET http://www.bbc.co.uk/tickerdata/"+file$+".dat HTTP/1.0"
  70.  "XSocket_Write",socket%!0,request$+
  71. (request$)+4 
  72. ptr%;flags%
  73.  (ptr%=0 
  74.  (flags% 
  75. 1)=1) 
  76.  !ptr% <> 36 
  77. 3U            connecterror=
  78. :error$="Failed to connect to server":connectstatus=4:
  79. connectstatus=3.5
  80.  at 0 in output file
  81. ("<ticker$dir>."+file$)
  82. output=
  83. output_pos=0
  84. length=0
  85. <"    a=
  86. ("<ticker$dir>."+file$)
  87. resolve
  88.  status,ptr%,flags%
  89. host$="www.bbc.co.uk"
  90.  proxyonoff 
  91.  host$=$(proxyhost%)
  92.  mtresolv 
  93.  &66000,0,host$ 
  94. ,ptr%,flags%
  95.  ptr%=0 
  96.  (flags% 
  97.  1)=1 
  98.  connecterror=
  99. :error$="Resolving address failed":connectstatus=4:
  100. G& ip%=!!(ptr%!16):connectstatus=2.5
  101.  &46001,host$ 
  102.  status,ptr%;flags%
  103.  (flags% 
  104.  (status <> 36) 
  105.      
  106.  ptr%=0 
  107.  (flags% 
  108.  1)=1 
  109.  connecterror=
  110. :error$="Resolving address failed":connectstatus=4:b%!0=resolver%:
  111.  "Wimp_CloseWindow",,b%:
  112. L/   b%!0=resolver%:
  113.  "Wimp_CloseWindow",,b%
  114. M(   ip%=!!(ptr%!16):connectstatus=2.5
  115. connect
  116.  ptr%,flags%
  117. host$="www.bbc.co.uk"
  118. port=80 
  119.  &FFFF
  120.  proxyonoff 
  121.    host$=$(proxyhost%)
  122. X$   port=
  123. ($(proxyport%)) 
  124.  &FFFF
  125.  right lets try to connect
  126. [Jb%!0=2 
  127.  ((port 
  128. 256)<<16) 
  129.  ((port 
  130. 256)<<24):b%!4=ip%:b%!8=0:b%!12=0
  131.  "XSocket_Connect",socket%!0,b%,16 
  132.  ptr%;flags%
  133.  (flags% 
  134.  1)=1 
  135.  !ptr% 
  136. _.     
  137.  36:connectstatus=2.5:connecterror=
  138. `.     
  139.  37:connectstatus=2.5:connecterror=
  140. a)     
  141.  56:connectstatus=3:
  142.  beep 
  143.      
  144. cB        connecterror=
  145. :error$=
  146. string0(ptr%+4):connectstatus=4
  147. dD        
  148.  error$="Invalid argument" 
  149.  error$="Connection failed"
  150. addnewicon
  151. jE                   
  152.  (clickerror 
  153.  connecterror) 
  154. readfile
  155.                    
  156.  clickerror 
  157.  connecterror 
  158.  a$="  
  159.   "+error$+".  See help file for troubleshooting.":clickerror=
  160. :clickable(i+1)=
  161. l0                   
  162. updateicon((i+1)
  163. 7,a$,0)
  164. m,                   current=(current+1)
  165.  "OS_ReadMonotonicTime" 
  166.  sa-saold>3 
  167.       saold=sa
  168.       
  169.  i=0 
  170.          b%!0=main%:b%!4=i
  171. w'         
  172.  "Wimp_GetIconState",,b%
  173.          
  174.  b%!16>132 
  175. y+            x=b%!8-speed:xx=b%!16-speed
  176.             
  177.  x<132 
  178.  x=132
  179. {             
  180.  xx<132 
  181.  x=132
  182. |>             
  183.    SYS "Wimp_ResizeIcon",main%,i,x,-49,xx,-3
  184. }+               
  185.  "Wimp_DeleteIcon",,b%
  186. ~.                b%!4=main%:b%!8=x:b%!16=xx
  187. -               
  188.  "Wimp_CreateIcon",,b%+4
  189. >                
  190.  i=current 
  191.  xx<windowwidth 
  192. addnewicon
  193.          
  194.       
  195.  "Wimp_BlockCopy",main%,132+speed,-49,windowwidth+speed,-3,132,-49
  196. threepointfive
  197.  mustget
  198. =    
  199.  "XSocket_Read",socket%!0,buffer%,2048 
  200.  len;flags%
  201. #    
  202.  len 
  203.  ((flags% 
  204. 1)=1) 
  205.  stuff in buffer
  206.      d=0
  207.        
  208.         a$=""
  209.          
  210.           a$+=
  211.  buffer%?d
  212.           d+=1
  213. >         
  214.  buffer%?(d-1) = 10 
  215.  buffer%?(d-1) = 13 
  216.  d=len
  217. +        
  218. a$,9)="BBCONLINE" 
  219.  output=
  220.          
  221. a$,7)="REFRESH" 
  222.                 b=
  223.                 a$=
  224. a$,b-1)
  225. 2                
  226.  $(headline%(8))<> 
  227. a$,b-9) 
  228.                 mustget=
  229. ,                $(headline%(8))=
  230. a$,b-9)
  231.                  
  232. save_config
  233.                 
  234.                 a$+=
  235.         
  236. )        
  237. a$,15)="Content-Length:" 
  238.                 b=
  239.                 a$=
  240. a$,b-1)
  241. '                length=
  242. a$,b-16))
  243.         
  244.             
  245.  output 
  246.                
  247. #a=output_pos
  248.               
  249. #a,a$;
  250.                output_pos=
  251. 4                  
  252.  length=output_pos 
  253.  length 
  254.                      
  255. V                      
  256.  headlineget 
  257.  length <1000 
  258.  headlineget=
  259. load_headlines
  260. )                      connectstatus=4
  261. :                      
  262.  "Socket_Shutdown",socket%!0,2
  263. 8                      
  264.  FIRSTGO 
  265.  connectstatus+=1
  266. ,                      
  267.  toggle 
  268. toggle
  269.                   
  270.             
  271.        
  272.  d=len
  273.         
  274.  mustget 
  275.  headlineget=
  276. firstone
  277.  get first icon data
  278.  connecterror 
  279. readfile 
  280.  a$="  "
  281.  plot that first one
  282. getmodeinfo
  283. updateicon(0,a$,windowwidth-154)
  284.  connectstatus=5
  285.  FIRSTGO=
  286. readfile
  287.  x1$, x2$
  288. ("<ticker$dir>.story2")
  289. extent=
  290. #y1=position
  291.   x1$=
  292.   x1=
  293.  x1=extent 
  294.  position=0 
  295.  position=x1
  296. x1$,5)="STORY" 
  297.  channel(
  298. x1$,1)))
  299.  x1=extent 
  300. #y1=0
  301.   x1$=
  302.  x1>11
  303. x1$="  
  304. x1$,x1-9)
  305.   x1=
  306.  x1=extent 
  307.  position=0 
  308.  position=x1
  309.   x2$=
  310.  x2$ <10 
  311.  clickable((i+1)
  312.  clickable((i+1)
  313. updateicon(number,text$,add)
  314.  before,bwidth
  315.  ** calculate width of icon **
  316.  wimp 
  317.  "Wimp_TextOp",1,text$,0 
  318.  width 
  319.  width=
  320.  text$*16
  321.  ** where is the icon before?
  322. before=(number+6)
  323. b%!0=main%:b%!4=before
  324.  "Wimp_GetIconState",,b%
  325. bwidth=b%!16
  326. b%!0=main%:b%!4=number
  327.  "Wimp_GetIconState",,b%
  328.  "Wimp_DeleteIcon",,b%
  329. 7  b%!4=main%:b%!8=bwidth+add:b%!16=bwidth+width+add
  330.  "Wimp_CreateIcon",,b%+4
  331.   SYS "Wimp_ResizeIcon",main%,number,bwidth+add,-49,bwidth+width+add,-3
  332. $(message%(number))=a$
  333. )b%!0=main%:b%!4=number:b%!8=0:b%!12=0
  334.  "Wimp_SetIconState",,b%
  335. close
  336.  "Wimp_CloseDown",task%,&4B534154
  337. "unset ticker$running"
  338. "unset ticker$Update"
  339.  "Wimp_Poll",,b% 
  340. windowopen
  341.  "Wimp_CloseWindow",,b%
  342.  b%!0=main% 
  343.  inwindow=
  344. makeblack(blue):blue=7
  345.  b%!0=main% 
  346.  inwindow=
  347. mouseclick
  348. processkey(b%!0,b%!4,b%!24)
  349. menuclick
  350.  17,18,19:
  351. receive(r%,b%)
  352. depressed 
  353.  dragging=
  354. userdrag
  355. depressed
  356.  data
  357.  "Wimp_GetPointerInfo",,b%
  358. data=b%!8
  359.  data/2 <> 
  360. (data/2) 
  361.  data=
  362.  data=
  363.     =data
  364. userdrag
  365. b%!0=main%
  366.  "Wimp_GetWindowState",,b%
  367. windowwidth=b%!12-b%!4
  368. processkey(win,ico,key)
  369.  "Wimp_ProcessKey",key
  370. windowopen
  371.  !b%=main% 
  372.  modechanging 
  373. getmodeinfo 
  374.  "Wimp_OpenWindow",,b%
  375. receive(u,t%)
  376.  t%!16 
  377.  0:quit%=
  378.  &400C1
  379.      modechanging=
  380.  &4AF80
  381.      
  382.  u<>19 
  383. #.     
  384.  now try and load prog to launch url
  385. $>     
  386.  "XOS_ReadVarVal","Alias$URLOpen_HTTP",b%,256 
  387.       
  388.  u = 0 
  389.              clickerror=
  390. 'O             error$="No Application has been seen that can launch this URL"
  391.       
  392. ).             $b%="URLOpen_HTTP "+launched$
  393. *'             
  394.  "Wimp_StartTask",b%
  395.       
  396. dragging=
  397. headlineget=
  398. toggle=
  399.  clickable(7)
  400. inwindow=
  401. blue=7
  402. modechanging=
  403. FIRSTGO=
  404. output=
  405.  socket% &10
  406.  headline%(8)
  407.  buffer% 2048
  408. connectstatus=0
  409. clickerror=
  410. connecterror=
  411. position=0
  412. current=0
  413.  b% 2048, menspc% 512, ws% 3072
  414.  message%(6)
  415.  channel(8)
  416. wsend%=ws%+3072
  417. quit%=
  418. connected=
  419. load_templates
  420. load_config
  421. ticker_menu
  422. attach(tickermenu%,0,infobox%)
  423. test_resolver
  424. init_sockets
  425. getmodeinfo
  426. test_resolver
  427.  ptr%,flags%
  428.  "XOS_Module",18,"Resolver" 
  429.  ,,,ptr%;flags%
  430.  (flags% 
  431.  mtresolv=
  432.  mtresolv=
  433. getmodeinfo
  434.  height%
  435. modechanging=
  436.  "OS_ReadModeVariable",-1,11 
  437.  ,,modewidth
  438.  "OS_ReadModeVariable",-1,12 
  439.  ,,modeheight
  440. modewidth+=1:modeheight+=1
  441.  connectstatus 
  442. !b%=main%
  443. ^, b%!0=main%:
  444.  "Wimp_GetWindowState",,b%
  445. _2 b%!4=leftwindow:b%!16=topwindow:b%!8=b%!16-52
  446.  b%!12=b%!4+windowwidth
  447.  b%!12>modewidth*2 
  448.  b%!12=modewidth*2:windowwidth=b%!12-b%!4
  449.  toggle 
  450.  b%!12=b%!4+132
  451.  autoadjust 
  452.     windowwidth=modewidth*2
  453. e-    
  454.  windowwidth>3500 
  455.  windowwidth=3500
  456. f+    
  457.  windowwidth<500 
  458.  windowwidth=500
  459.     height=modeheight*2
  460.  iconbar 
  461.  height=188
  462. i<    b%!4=0:b%!8=height-52:b%!12=windowwidth:b%!16=height
  463.  toggle 
  464.  b%!12=132
  465.  "Wimp_OpenWindow",,b%
  466. toggle
  467.  toggle 
  468.     toggle=
  469.    toggle=
  470.    !b%=main%
  471. w#   
  472.  "Wimp_GetWindowState",,b%
  473.  toggle 
  474.    b%!12=b%!4+132
  475.    b%!12=b%!4+windowwidth
  476.  "Wimp_OpenWindow",,b%
  477. init_sockets
  478.  create a new socket for use, internet, stream
  479.  "Socket_Creat",2,1,0 
  480.  socket%!0
  481. !b%=-1
  482.  "Socket_Ioctl",socket%!0,&8004667E,b%
  483. load_config
  484.  a, b, r$
  485. ("<ticker$dir>.choices")
  486.    r$=
  487.    speed=
  488. (r$)*2
  489.    tempspeed=speed
  490.    $(speed%)=
  491. (speed*2)
  492.    updateonoff=
  493.    sleep=
  494.  updateonoff 
  495. iconstate(config%,7,1)
  496.  sleep 
  497. iconstate(config%,32,1)   
  498.    r$=
  499.    update=
  500.    tempupdate=update
  501. -   $(update%)="Every "+
  502. (update)+" mins."
  503.  b=1 
  504.    r$=
  505.     channel(b)=
  506. 1    
  507.  channel(b) 
  508. iconstate(config%,b+11,1)
  509.    windowwidth=
  510.  windowwidth<500 
  511.  windowwidth=500
  512.  windowwidth>3500 
  513.  windowwidth=3500
  514.    $(proxyhost%)=
  515.    temphost$=$(proxyhost%)
  516.    $(proxyport%)=
  517.     tempport=
  518. ($(proxyport%))
  519.    r$=
  520.    proxyonoff=
  521.  proxyonoff 
  522. iconstate(config%,23,1)
  523.    $(headline%(8))=
  524.    autoadjust=
  525.  autoadjust 
  526. iconstate(config%,28,1)
  527.    iconbar=
  528.    leftwindow=
  529.    topwindow=
  530.    beep=
  531.  beep 
  532. iconstate(config%,30,1)
  533.    lowgraphics=
  534.  lowgraphics 
  535. iconstate(config%,29,1)
  536.    colour=
  537.  colour<0 
  538.  colour>15 
  539.  colour=15         
  540. load_headlines
  541. load_headlines
  542.  a,b,r$
  543. ("<ticker$dir>.headline")
  544.       r$=
  545.  b=0 
  546.      $(headline%(b))=
  547. save_config
  548.  a, b, i
  549. ("<ticker$dir>.choices")
  550. (tempspeed/2)
  551. "    b=
  552. geticonstate(config%,7)
  553. #    b=
  554. geticonstate(config%,32)
  555. (b)       
  556. (tempupdate)
  557.  i=1 
  558. &    b+=
  559. geticonstate(config%,11+i)
  560.  i=1 
  561. 4    
  562.  channel(i)=
  563. geticonstate(config%,11+i)
  564. (channel(i))
  565. (windowwidth)
  566. #a,$(proxyhost%)
  567. #a,$(proxyport%)
  568. #    b=
  569. geticonstate(config%,23)
  570. #a,$(headline%(8))
  571. #    b=
  572. geticonstate(config%,28)
  573. (iconbar)
  574.    !b%=main%
  575.  "Wimp_GetWindowState",,b%
  576. (b%!4)
  577. (b%!16)
  578. "   b=
  579. geticonstate(config%,30)
  580. "   b=
  581. geticonstate(config%,29)
  582.  colour  
  583. load_config
  584. load_templates
  585.  "Wimp_OpenTemplate",,"<ticker$Dir>.Templates"
  586.  "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"main", 0 
  587.  ,,ws%
  588. message%(0)=b%!(108+(32*0))
  589. message%(1)=b%!(108+(32*1))
  590. message%(2)=b%!(108+(32*2))
  591. message%(3)=b%!(108+(32*3))
  592. message%(4)=b%!(108+(32*4))
  593. message%(5)=b%!(108+(32*5))
  594. message%(6)=b%!(108+(32*6))
  595.  "Wimp_CreateWindow",,b% 
  596.  main%
  597.  "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"Info", 0 
  598.  ,,ws%
  599.  "Wimp_CreateWindow",,b% 
  600.  infobox%
  601.  "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"config", 0 
  602.  ,,ws%
  603. speed%=b%!(108+(32*21))
  604. update%=b%!(108+(32*6))
  605.  i=0 
  606. #headline%(i)=b%!(108+32*(i+12))
  607. proxyhost%=b%!(108+(32*24))
  608. proxyport%=b%!(108+(32*25))
  609.  "Wimp_CreateWindow",,b% 
  610.  config%
  611.  "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"message", 0 
  612.  ,,ws%
  613.  "Wimp_CreateWindow",,b% 
  614.  resolver%
  615.  "Wimp_CloseTemplate"
  616.  ** resize icons **
  617.  i=0 
  618.  SYS "Wimp_ResizeIcon",main%,i,132,-49,132,-3
  619. >             
  620.    SYS "Wimp_ResizeIcon",main%,i,x,-49,xx,-3
  621. +                      b%!0=main%:b%!4=i
  622. '         
  623.  "Wimp_GetIconState",,b%
  624. +               
  625.  "Wimp_DeleteIcon",,b%
  626.     1                b%!4=main%:b%!8=132:b%!16=132
  627. -               
  628.  "Wimp_CreateIcon",,b%+4
  629. colourchange
  630.  icon
  631.  "Wimp_GetPointerInfo",,b%
  632. icon=b%!16
  633.  icon>-1 
  634.  icon <8 
  635.  icon<>7 
  636.  icon<>blue 
  637.  clickable(icon) 
  638. makeblue(icon)
  639.  blue<>7 
  640.  clickable(blue) 
  641. makeblack(blue)
  642.    blue=icon
  643. makeblue(i)
  644.         b%!0=main%:b%!4=i
  645. )           
  646.  "Wimp_GetIconState",,b%
  647. #           b%!8=colour*&1000000
  648.            b%!12=&F000000
  649.  )           
  650.  "Wimp_SetIconState",,b%
  651. makeblack(i)
  652.  i<0 
  653.  i>6 
  654.         b%!0=main%:b%!4=i
  655. &)           
  656.  "Wimp_GetIconState",,b%
  657.            b%!8=&7000000
  658.            b%!12=&F000000
  659. ))           
  660.  "Wimp_SetIconState",,b%
  661. mouseclick
  662.  b%!12 
  663.  main%:
  664.  b%!8 
  665. 0.    
  666. showmenu(tickermenu%,!b%-64,b%!4)
  667.  4:i=b%!16:
  668. 2Z        
  669.  7:b%!0=main%:b%!4=1:b%!8=10:b%!12=10:b%!16=50:b%!20=50:
  670.  "Wimp_DragBox",,b%
  671.         
  672.         
  673.  i<>7 
  674. 5+           a$=
  675. geticontext(main%,b%!16)
  676.            
  677. load_url(a$)
  678.         
  679.  1:i=b%!16:
  680.          
  681. toggle
  682.          
  683. ;          
  684.  i<>7 
  685.  dragging=
  686. <S         b%!0=main%:b%!4=2:b%!8=0:b%!12=0:b%!16=0:b%!20=0:
  687.  "Wimp_DragBox",,b%
  688.          
  689.  config%:
  690.  b%!16 
  691. @5       
  692.  3:b%!0=config%:
  693.  "Wimp_CloseWindow",,b%
  694. AB       
  695. save_config:b%!0=config%:
  696.  "Wimp_CloseWindow",,b%
  697.        
  698.  tempspeed>2 
  699.  tempspeed-=2:$(speed%)=
  700. (tempspeed/2):b%!0=config%:b%!4=21:b%!8=0:b%!12=0:
  701.  "Wimp_SetIconState",,b%
  702.        
  703.  tempspeed<20 
  704.  tempspeed+=2:$(speed%)=
  705. (tempspeed/2):b%!0=config%:b%!4=21:b%!8=0:b%!12=0:
  706.  "Wimp_SetIconState",,b%
  707.        
  708.  tempupdate >1 
  709.  tempupdate-=1:$(update%)="Every "+
  710. (tempupdate)+" mins.":b%!0=config%:b%!4=6:b%!8=0:b%!12=0:
  711.  "Wimp_SetIconState",,b%
  712.        
  713.  tempupdate <60 
  714.  tempupdate+=1:$(update%)="Every "+
  715. (tempupdate)+" mins.":b%!0=config%:b%!4=6:b%!8=0:b%!12=0:
  716.  "Wimp_SetIconState",,b%
  717.        
  718. proxy_shade
  719.        
  720. update_shade
  721. H3       
  722.  27: 
  723. "Filer_OpenDir <ticker$dir>.help"
  724. proxy_shade
  725. geticonstate(config%,23)
  726.  i=24 
  727. iconshade(config%,i,
  728. update_shade
  729. geticonstate(config%,7)
  730. iconshade(config%,6,
  731. iconshade(config%,10,
  732. iconshade(config%,11,
  733. iconshade(config%,32,
  734. load_url(a$)
  735. a$,x2-5)
  736. ("<ticker$dir>.story2")
  737. #y2=0
  738.   x2$=
  739. x2$,8)="HEADLINE" 
  740.      x2=
  741.      x2$=
  742. x2$,x2-9)
  743.  x2=t2 
  744.  x2$=a$
  745.  x2$=a$ 
  746.   x2$=
  747.   t2=
  748.   x2$=
  749. x2$,t2-4)
  750.  x2$<>"" 
  751. launch_url(x2$,1)
  752. ticker_update
  753. sysvar("Ticker$Update","0")
  754.  Shit! Time to update the ticker
  755.  we ARE NOT connected, honest
  756.  "OS_ReadMonotonicTime" 
  757.  time%
  758. connectstatus=0
  759. position=0
  760. init_sockets
  761. connectstatus=1
  762.  mtresolv 
  763. open_resolver_window
  764. open_resolver_window
  765. b%!0=resolver%
  766.  "Wimp_GetWindowState",,b%
  767. %b%!4=modewidth-196:b%!12=b%!4+392
  768. %b%!8=modeheight-96:b%!16=b%!8+192
  769.  "Wimp_OpenWindow",,b%
  770. launch_url(a$,do)
  771.  hi%, len%, temp$
  772. !b%!0=256:b%!12=0:b%!16=&4AF80
  773.  lowgraphics 
  774.  hi%=
  775. a$,"/hi/"):len%=
  776.  temp$=
  777. a$,len%-(len%-hi%)-1)
  778. temp$+="/low/"
  779. temp$+=
  780. a$,len%-hi%-3)
  781. a$=temp$
  782. $(b%+20)=a$+
  783.  "Wimp_SendMessage",18,b%,0,0
  784. launched$=a$
  785. menuclick
  786. c%=b%+900
  787.  "Wimp_GetPointerInfo",,c%
  788. adj%=(c%!8 
  789.  "Wimp_DecodeMenu",,topmenu%,b%,c%
  790.  $c% 
  791.  "Quit":quit%=
  792.  "Update Now":
  793. ticker_update
  794.  "The BBC":
  795. launch_url("http://www.bbc.co.uk/",0)
  796.  "News Online":
  797. launch_url("http://news.bbc.co.uk",0)
  798.  "Updates...":
  799. launch_url("http://www.geocities.com/Paris/Lights/7724",0)
  800.  "Choices":
  801. update_choices
  802.  adj% 
  803. showmenu(topmenu%,topx%,topy%)
  804. update_choices
  805.  c%=1 
  806. iconstate(config%,c%+11,-channel(c%))
  807. $(speed%)=
  808. (speed/2)
  809. *$(update%)="Every "+
  810. (update)+" mins."
  811. $(proxyport%)=
  812. (tempport)
  813. $(proxyhost%)=temphost$
  814. iconstate(config%,23,proxyonoff)
  815. iconstate(config%,28,autoadjust)
  816. iconstate(config%,30,beep)
  817. iconstate(config%,29,lowgraphics)
  818. proxy_shade
  819. update_shade
  820. E!b%=config%:
  821.  "Wimp_GetWindowState",,b%:
  822.  "Wimp_OpenWindow",,b%
  823.  ---- menu stuff ----
  824. make_menu
  825. start%=menspc%
  826.  title$
  827. $(start%)=title$
  828. start%?12=7
  829. start%?13=2
  830. start%?14=7
  831. start%?15=0
  832. start%!20=44
  833. start%!24=0
  834. width%=
  835. (title$)-3
  836. menspc%+=28
  837.  item$
  838.  item$<>"*" 
  839. !menspc%=0
  840. writeable%=
  841. item$,"_")
  842.  ul% 
  843. tail$=
  844. item$,
  845. (item$)-ul%)
  846. tail$,"T") !menspc%=!menspc% 
  847. tail$,"D") !menspc%=!menspc% 
  848. tail$,"W") !menspc%=!menspc% 
  849.  4:writeable%=
  850.  buffer%:
  851.  buflen%
  852. tail$,"M") !menspc%=!menspc% 
  853. item$=
  854. item$,ul%-1)
  855.  item$>width% width%=
  856.  item$
  857. menspc%!4=-1
  858.  writeable% 
  859. Zmenspc%!8=&0700F121:menspc%!12=buffer%:menspc%!16=-1:menspc%!20=buflen%:$buffer%=item$
  860.  item$<12 
  861. +menspc%!8=&07000021:$(menspc%+12)=item$
  862. Imenspc%!8=&0700F121:menspc%!12=ws%:mwnspc%!16=-1:menspc%!20=
  863.  item$+1
  864. $ws%=item$:ws%+=
  865.  item$+1
  866. menspc%+=24
  867.  item$="*"
  868. start%!16=width%*16+32
  869. %!(menspc%-24)=!(menspc%-24) 
  870. mptr%=menspc%
  871. =start%
  872. attach(menu%,item%,sub%)
  873. !(menu%+28+item%*24+4)=sub%
  874. showmenu(menu%,x%,y%)
  875. $topmenu%=menu%:topx%=x%:topy%=y%
  876.  "Wimp_CreateMenu",,menu%,x%,y%
  877. ticker_menu
  878.  Ticker,Info,Choices,Update Now,Quit_D,The BBC,News Online,Updates...,*
  879. tickermenu%=
  880. make_menu
  881. geticonstate(win%,icon%)
  882. 2!b%=win%:b%!4=icon%:
  883.  "Wimp_GetIconState",,b%
  884. =(b%!24>>21 
  885.  1)>0
  886. iconstate(win%,icon%,type%)
  887.  s%,t%
  888.  type% 
  889.  0:s%=0<<21:t%=1<<21
  890.  -1,1:s%=1<<21:t%=1<<21
  891.  2:s%=1<<21:t%=0<<21
  892. )b%!0=win%:b%!4=icon%:b%!8=s%:b%!12=t%
  893.  "Wimp_SetIconState",,b%
  894. iconshade(win%,icon%,type%)
  895.  s%,t%
  896.  type% 
  897.  0:s%=0<<22:t%=1<<22
  898.  -1,1:s%=1<<22:t%=1<<22
  899.  2:s%=1<<22:t%=0<<22
  900. )b%!0=win%:b%!4=icon%:b%!8=s%:b%!12=t%
  901.  "Wimp_SetIconState",,b%
  902. geticontext(win%,icon%)
  903. 3b%!0=win%:b%!4=icon%:
  904.  "Wimp_GetIconState",,b%
  905.  ((b%!24) 
  906.  &100)=0 
  907. string0(b%+28)
  908. string0(b%!28)
  909. string0(a%):
  910.  a%=0 
  911. ?a%>31 
  912. (a$)<255:a$=a$+
  913. ?a%:a%=a%+1:
  914. sysvar(var$,val$)
  915.  "OS_SetVarVal",var$,val$,
  916.  val$,0,0
  917. sysvar(var$)
  918.  len%,val$,F%
  919.  "XOS_ReadVarVal",var$,b%,256,0,0 
  920.  ,,len%;F%
  921.  len%=0
  922. b%?len%=13
  923.